package thread.pipedthread;

import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.PipedOutputStream;

public class WriterThread extends Thread{
	PipedOutputStream po = null;
	public WriterThread(PipedOutputStream po){
		this.po=po;
	}
	public void run() {
		try {
			File f = new File("f:/书。/杂。/三.txt");
			FileInputStream fs = new FileInputStream(f);
			int i = 0;
			while(( i = fs.read())!=-1){
				po.write(i);
			}
		} catch (Exception e) {
			e.printStackTrace();
		}finally{
			try {
				po.close();
			} catch (IOException e) {
				e.printStackTrace();
			}
		}
	}
}
